3.2.47 \(\int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx\) [147]

3.2.47.1 Optimal result
3.2.47.2 Mathematica [A] (verified)
3.2.47.3 Rubi [A] (verified)
3.2.47.4 Maple [A] (verified)
3.2.47.5 Fricas [B] (verification not implemented)
3.2.47.6 Sympy [F]
3.2.47.7 Maxima [A] (verification not implemented)
3.2.47.8 Giac [A] (verification not implemented)
3.2.47.9 Mupad [B] (verification not implemented)

3.2.47.1 Optimal result

Integrand size = 28, antiderivative size = 138 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=\frac {\left (a^2+b^2\right )^2}{3 a^3 b^2 d (b+a \cot (c+d x))^3}+\frac {\frac {a}{b^3}-\frac {b}{a^3}}{d (b+a \cot (c+d x))^2}+\frac {\frac {1}{a^3}+\frac {3 a}{b^4}}{d (b+a \cot (c+d x))}-\frac {4 a \log (b+a \cot (c+d x))}{b^5 d}-\frac {4 a \log (\tan (c+d x))}{b^5 d}+\frac {\tan (c+d x)}{b^4 d} \]

output
1/3*(a^2+b^2)^2/a^3/b^2/d/(b+a*cot(d*x+c))^3+(a/b^3-b/a^3)/d/(b+a*cot(d*x+ 
c))^2+(1/a^3+3*a/b^4)/d/(b+a*cot(d*x+c))-4*a*ln(b+a*cot(d*x+c))/b^5/d-4*a* 
ln(tan(d*x+c))/b^5/d+tan(d*x+c)/b^4/d
 
3.2.47.2 Mathematica [A] (verified)

Time = 2.38 (sec) , antiderivative size = 133, normalized size of antiderivative = 0.96 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=\frac {3 b^4 \sec ^4(c+d x)-4 \left (a^2+b^2\right ) \left (a^2+b^2+3 a b \tan (c+d x)+3 b^2 \tan ^2(c+d x)\right )+6 a (a+b \tan (c+d x)) \left (a^2+b^2-4 a (a+b \tan (c+d x))-2 \log (a+b \tan (c+d x)) (a+b \tan (c+d x))^2\right )}{3 b^5 d (a+b \tan (c+d x))^3} \]

input
Integrate[Sec[c + d*x]^2/(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]
 
output
(3*b^4*Sec[c + d*x]^4 - 4*(a^2 + b^2)*(a^2 + b^2 + 3*a*b*Tan[c + d*x] + 3* 
b^2*Tan[c + d*x]^2) + 6*a*(a + b*Tan[c + d*x])*(a^2 + b^2 - 4*a*(a + b*Tan 
[c + d*x]) - 2*Log[a + b*Tan[c + d*x]]*(a + b*Tan[c + d*x])^2))/(3*b^5*d*( 
a + b*Tan[c + d*x])^3)
 
3.2.47.3 Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 128, normalized size of antiderivative = 0.93, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 3567, 522, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\cos (c+d x)^2 (a \cos (c+d x)+b \sin (c+d x))^4}dx\)

\(\Big \downarrow \) 3567

\(\displaystyle -\frac {\int \frac {\left (\cot ^2(c+d x)+1\right )^2 \tan ^2(c+d x)}{(b+a \cot (c+d x))^4}d\cot (c+d x)}{d}\)

\(\Big \downarrow \) 522

\(\displaystyle -\frac {\int \left (\frac {4 a^2}{b^5 (b+a \cot (c+d x))}-\frac {4 \tan (c+d x) a}{b^5}+\frac {\tan ^2(c+d x)}{b^4}+\frac {3 a^4+b^4}{b^4 (b+a \cot (c+d x))^2 a^2}+\frac {2 \left (a^4-b^4\right )}{b^3 (b+a \cot (c+d x))^3 a^2}+\frac {\left (a^2+b^2\right )^2}{b^2 (b+a \cot (c+d x))^4 a^2}\right )d\cot (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {-\frac {\frac {1}{a^3}+\frac {3 a}{b^4}}{a \cot (c+d x)+b}-\frac {\frac {a}{b^3}-\frac {b}{a^3}}{(a \cot (c+d x)+b)^2}-\frac {\left (a^2+b^2\right )^2}{3 a^3 b^2 (a \cot (c+d x)+b)^3}-\frac {4 a \log (\cot (c+d x))}{b^5}+\frac {4 a \log (a \cot (c+d x)+b)}{b^5}-\frac {\tan (c+d x)}{b^4}}{d}\)

input
Int[Sec[c + d*x]^2/(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]
 
output
-((-1/3*(a^2 + b^2)^2/(a^3*b^2*(b + a*Cot[c + d*x])^3) - (a/b^3 - b/a^3)/( 
b + a*Cot[c + d*x])^2 - (a^(-3) + (3*a)/b^4)/(b + a*Cot[c + d*x]) - (4*a*L 
og[Cot[c + d*x]])/b^5 + (4*a*Log[b + a*Cot[c + d*x]])/b^5 - Tan[c + d*x]/b 
^4)/d)
 

3.2.47.3.1 Defintions of rubi rules used

rule 522
Int[((e_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_. 
), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*(c + d*x)^n*(a + b*x^2)^p, x], 
x] /; FreeQ[{a, b, c, d, e, m, n}, x] && IGtQ[p, 0]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3567
Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*si 
n[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[x^m*((b 
+ a*x)^n/(1 + x^2)^((m + n + 2)/2)), x], x, Cot[c + d*x]], x] /; FreeQ[{a, 
b, c, d}, x] && IntegerQ[n] && IntegerQ[(m + n)/2] && NeQ[n, -1] &&  !(GtQ[ 
n, 0] && GtQ[m, 1])
 
3.2.47.4 Maple [A] (verified)

Time = 2.99 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.86

method result size
derivativedivides \(\frac {\frac {\tan \left (d x +c \right )}{b^{4}}-\frac {a^{4}+2 a^{2} b^{2}+b^{4}}{3 b^{5} \left (a +b \tan \left (d x +c \right )\right )^{3}}+\frac {2 a \left (a^{2}+b^{2}\right )}{b^{5} \left (a +b \tan \left (d x +c \right )\right )^{2}}-\frac {6 a^{2}+2 b^{2}}{b^{5} \left (a +b \tan \left (d x +c \right )\right )}-\frac {4 a \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{5}}}{d}\) \(118\)
default \(\frac {\frac {\tan \left (d x +c \right )}{b^{4}}-\frac {a^{4}+2 a^{2} b^{2}+b^{4}}{3 b^{5} \left (a +b \tan \left (d x +c \right )\right )^{3}}+\frac {2 a \left (a^{2}+b^{2}\right )}{b^{5} \left (a +b \tan \left (d x +c \right )\right )^{2}}-\frac {6 a^{2}+2 b^{2}}{b^{5} \left (a +b \tan \left (d x +c \right )\right )}-\frac {4 a \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{5}}}{d}\) \(118\)
risch \(\frac {8 i \left (i a \,b^{3} {\mathrm e}^{2 i \left (d x +c \right )}+3 i a^{3} b \,{\mathrm e}^{2 i \left (d x +c \right )}+3 a^{4} {\mathrm e}^{6 i \left (d x +c \right )}-9 a^{2} b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-9 i a^{3} b \,{\mathrm e}^{6 i \left (d x +c \right )}+6 i a^{3} b +9 a^{4} {\mathrm e}^{4 i \left (d x +c \right )}+3 a^{2} b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+4 i a \,b^{3}+3 i a \,b^{3} {\mathrm e}^{6 i \left (d x +c \right )}+9 a^{4} {\mathrm e}^{2 i \left (d x +c \right )}+11 a^{2} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+4 b^{4} {\mathrm e}^{2 i \left (d x +c \right )}-6 i a \,b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-12 i a^{3} b \,{\mathrm e}^{4 i \left (d x +c \right )}+3 a^{4}-a^{2} b^{2}-2 b^{4}\right )}{3 \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right )^{3} \left (i a +b \right ) b^{4} d}+\frac {4 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b^{5} d}-\frac {4 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{b^{5} d}\) \(361\)
norman \(\frac {-\frac {8 a^{4}+2 b^{4}}{6 b^{5} d}-\frac {\left (8 a^{4}+2 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{6 b^{5} d}+\frac {\left (144 a^{3}+16 a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d \,a^{2} b^{2}}-\frac {\left (144 a^{3}+16 a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{3 d \,a^{2} b^{2}}-\frac {\left (8 a^{5}+48 a^{3} b^{2}-14 a \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d a \,b^{5}}+\frac {2 \left (8 a^{5}+36 a^{3} b^{2}+2 a \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{3 d a \,b^{5}}+\frac {2 \left (8 a^{5}+36 a^{3} b^{2}+2 a \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{3 d a \,b^{5}}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )^{3}}+\frac {4 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{5} d}+\frac {4 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{5} d}-\frac {4 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{b^{5} d}\) \(374\)
parallelrisch \(\frac {4 \left (\left (-a^{5}+3 a^{3} b^{2}\right ) \cos \left (4 d x +4 c \right )+2 \left (-3 a^{4} b -a^{2} b^{3}\right ) \sin \left (2 d x +2 c \right )+\left (-3 a^{4} b +a^{2} b^{3}\right ) \sin \left (4 d x +4 c \right )-4 a^{5} \cos \left (2 d x +2 c \right )-3 a^{5}-3 a^{3} b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )+4 \left (\left (a^{5}-3 a^{3} b^{2}\right ) \cos \left (4 d x +4 c \right )+2 \left (3 a^{4} b +a^{2} b^{3}\right ) \sin \left (2 d x +2 c \right )+\left (3 a^{4} b -a^{2} b^{3}\right ) \sin \left (4 d x +4 c \right )+4 a^{5} \cos \left (2 d x +2 c \right )+3 a^{5}+3 a^{3} b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+4 \left (\left (a^{5}-3 a^{3} b^{2}\right ) \cos \left (4 d x +4 c \right )+2 \left (3 a^{4} b +a^{2} b^{3}\right ) \sin \left (2 d x +2 c \right )+\left (3 a^{4} b -a^{2} b^{3}\right ) \sin \left (4 d x +4 c \right )+4 a^{5} \cos \left (2 d x +2 c \right )+3 a^{5}+3 a^{3} b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\frac {2 \left (-2 a^{5}-9 a^{3} b^{2}+a \,b^{4}\right ) \cos \left (4 d x +4 c \right )}{3}+\frac {4 \left (9 a^{2} b^{3}+b^{5}\right ) \sin \left (2 d x +2 c \right )}{3}+\frac {2 \left (-9 a^{2} b^{3}-b^{5}\right ) \sin \left (4 d x +4 c \right )}{3}+\frac {16 \left (-a^{5}-a \,b^{4}\right ) \cos \left (2 d x +2 c \right )}{3}-4 a^{5}+6 a^{3} b^{2}+2 a \,b^{4}}{d \,b^{5} \left (a^{2} \left (a^{2}-3 b^{2}\right ) \cos \left (4 d x +4 c \right )+a \left (4 a^{3} \cos \left (2 d x +2 c \right )+6 a^{2} b \sin \left (2 d x +2 c \right )+3 a^{2} b \sin \left (4 d x +4 c \right )+2 \sin \left (2 d x +2 c \right ) b^{3}-b^{3} \sin \left (4 d x +4 c \right )+3 a^{3}+3 a \,b^{2}\right )\right )}\) \(601\)

input
int(sec(d*x+c)^2/(cos(d*x+c)*a+b*sin(d*x+c))^4,x,method=_RETURNVERBOSE)
 
output
1/d*(tan(d*x+c)/b^4-1/3/b^5*(a^4+2*a^2*b^2+b^4)/(a+b*tan(d*x+c))^3+2*a/b^5 
*(a^2+b^2)/(a+b*tan(d*x+c))^2-(6*a^2+2*b^2)/b^5/(a+b*tan(d*x+c))-4*a/b^5*l 
n(a+b*tan(d*x+c)))
 
3.2.47.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 537 vs. \(2 (136) = 272\).

Time = 0.31 (sec) , antiderivative size = 537, normalized size of antiderivative = 3.89 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=\frac {3 \, a^{2} b^{4} + 3 \, b^{6} - 4 \, {\left (9 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - 2 \, b^{6}\right )} \cos \left (d x + c\right )^{4} + 6 \, {\left (5 \, a^{4} b^{2} + a^{2} b^{4} - 2 \, b^{6}\right )} \cos \left (d x + c\right )^{2} - 6 \, {\left ({\left (a^{6} - 2 \, a^{4} b^{2} - 3 \, a^{2} b^{4}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{4} b^{2} + a^{2} b^{4}\right )} \cos \left (d x + c\right )^{2} + {\left ({\left (3 \, a^{5} b + 2 \, a^{3} b^{3} - a b^{5}\right )} \cos \left (d x + c\right )^{3} + {\left (a^{3} b^{3} + a b^{5}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )\right )} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) + 6 \, {\left ({\left (a^{6} - 2 \, a^{4} b^{2} - 3 \, a^{2} b^{4}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{4} b^{2} + a^{2} b^{4}\right )} \cos \left (d x + c\right )^{2} + {\left ({\left (3 \, a^{5} b + 2 \, a^{3} b^{3} - a b^{5}\right )} \cos \left (d x + c\right )^{3} + {\left (a^{3} b^{3} + a b^{5}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2}\right ) + 2 \, {\left (2 \, {\left (3 \, a^{5} b - 7 \, a^{3} b^{3} - 6 \, a b^{5}\right )} \cos \left (d x + c\right )^{3} + {\left (11 \, a^{3} b^{3} + 9 \, a b^{5}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{3 \, {\left ({\left (a^{5} b^{5} - 2 \, a^{3} b^{7} - 3 \, a b^{9}\right )} d \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{3} b^{7} + a b^{9}\right )} d \cos \left (d x + c\right )^{2} + {\left ({\left (3 \, a^{4} b^{6} + 2 \, a^{2} b^{8} - b^{10}\right )} d \cos \left (d x + c\right )^{3} + {\left (a^{2} b^{8} + b^{10}\right )} d \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )\right )}} \]

input
integrate(sec(d*x+c)^2/(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="fricas" 
)
 
output
1/3*(3*a^2*b^4 + 3*b^6 - 4*(9*a^4*b^2 + 3*a^2*b^4 - 2*b^6)*cos(d*x + c)^4 
+ 6*(5*a^4*b^2 + a^2*b^4 - 2*b^6)*cos(d*x + c)^2 - 6*((a^6 - 2*a^4*b^2 - 3 
*a^2*b^4)*cos(d*x + c)^4 + 3*(a^4*b^2 + a^2*b^4)*cos(d*x + c)^2 + ((3*a^5* 
b + 2*a^3*b^3 - a*b^5)*cos(d*x + c)^3 + (a^3*b^3 + a*b^5)*cos(d*x + c))*si 
n(d*x + c))*log(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c) 
^2 + b^2) + 6*((a^6 - 2*a^4*b^2 - 3*a^2*b^4)*cos(d*x + c)^4 + 3*(a^4*b^2 + 
 a^2*b^4)*cos(d*x + c)^2 + ((3*a^5*b + 2*a^3*b^3 - a*b^5)*cos(d*x + c)^3 + 
 (a^3*b^3 + a*b^5)*cos(d*x + c))*sin(d*x + c))*log(cos(d*x + c)^2) + 2*(2* 
(3*a^5*b - 7*a^3*b^3 - 6*a*b^5)*cos(d*x + c)^3 + (11*a^3*b^3 + 9*a*b^5)*co 
s(d*x + c))*sin(d*x + c))/((a^5*b^5 - 2*a^3*b^7 - 3*a*b^9)*d*cos(d*x + c)^ 
4 + 3*(a^3*b^7 + a*b^9)*d*cos(d*x + c)^2 + ((3*a^4*b^6 + 2*a^2*b^8 - b^10) 
*d*cos(d*x + c)^3 + (a^2*b^8 + b^10)*d*cos(d*x + c))*sin(d*x + c))
 
3.2.47.6 Sympy [F]

\[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=\int \frac {\sec ^{2}{\left (c + d x \right )}}{\left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{4}}\, dx \]

input
integrate(sec(d*x+c)**2/(a*cos(d*x+c)+b*sin(d*x+c))**4,x)
 
output
Integral(sec(c + d*x)**2/(a*cos(c + d*x) + b*sin(c + d*x))**4, x)
 
3.2.47.7 Maxima [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.04 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=-\frac {\frac {13 \, a^{4} + 2 \, a^{2} b^{2} + b^{4} + 6 \, {\left (3 \, a^{2} b^{2} + b^{4}\right )} \tan \left (d x + c\right )^{2} + 6 \, {\left (5 \, a^{3} b + a b^{3}\right )} \tan \left (d x + c\right )}{b^{8} \tan \left (d x + c\right )^{3} + 3 \, a b^{7} \tan \left (d x + c\right )^{2} + 3 \, a^{2} b^{6} \tan \left (d x + c\right ) + a^{3} b^{5}} + \frac {12 \, a \log \left (b \tan \left (d x + c\right ) + a\right )}{b^{5}} - \frac {3 \, \tan \left (d x + c\right )}{b^{4}}}{3 \, d} \]

input
integrate(sec(d*x+c)^2/(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="maxima" 
)
 
output
-1/3*((13*a^4 + 2*a^2*b^2 + b^4 + 6*(3*a^2*b^2 + b^4)*tan(d*x + c)^2 + 6*( 
5*a^3*b + a*b^3)*tan(d*x + c))/(b^8*tan(d*x + c)^3 + 3*a*b^7*tan(d*x + c)^ 
2 + 3*a^2*b^6*tan(d*x + c) + a^3*b^5) + 12*a*log(b*tan(d*x + c) + a)/b^5 - 
 3*tan(d*x + c)/b^4)/d
 
3.2.47.8 Giac [A] (verification not implemented)

Time = 0.35 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.00 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=-\frac {\frac {12 \, a \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{b^{5}} - \frac {3 \, \tan \left (d x + c\right )}{b^{4}} - \frac {22 \, a b^{3} \tan \left (d x + c\right )^{3} + 48 \, a^{2} b^{2} \tan \left (d x + c\right )^{2} - 6 \, b^{4} \tan \left (d x + c\right )^{2} + 36 \, a^{3} b \tan \left (d x + c\right ) - 6 \, a b^{3} \tan \left (d x + c\right ) + 9 \, a^{4} - 2 \, a^{2} b^{2} - b^{4}}{{\left (b \tan \left (d x + c\right ) + a\right )}^{3} b^{5}}}{3 \, d} \]

input
integrate(sec(d*x+c)^2/(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="giac")
 
output
-1/3*(12*a*log(abs(b*tan(d*x + c) + a))/b^5 - 3*tan(d*x + c)/b^4 - (22*a*b 
^3*tan(d*x + c)^3 + 48*a^2*b^2*tan(d*x + c)^2 - 6*b^4*tan(d*x + c)^2 + 36* 
a^3*b*tan(d*x + c) - 6*a*b^3*tan(d*x + c) + 9*a^4 - 2*a^2*b^2 - b^4)/((b*t 
an(d*x + c) + a)^3*b^5))/d
 
3.2.47.9 Mupad [B] (verification not implemented)

Time = 27.24 (sec) , antiderivative size = 666, normalized size of antiderivative = 4.83 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=\frac {\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (10\,a^4+b^4\right )}{a^2\,b^3}-\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (4\,a^4+b^4\right )}{a\,b^4}-\frac {8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (10\,a^4-2\,a^2\,b^2+b^4\right )}{a^2\,b^3}+\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (10\,a^4+b^4\right )}{a^2\,b^3}-\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (36\,a^6-88\,a^4\,b^2+a^2\,b^4-4\,b^6\right )}{3\,a^3\,b^4}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (36\,a^6-88\,a^4\,b^2+a^2\,b^4-4\,b^6\right )}{3\,a^3\,b^4}+\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a^4+b^4\right )}{a\,b^4}}{d\,\left (a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (12\,a\,b^2-4\,a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (12\,a\,b^2-4\,a^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (24\,a\,b^2-6\,a^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (18\,a^2\,b-8\,b^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (18\,a^2\,b-8\,b^3\right )+a^3+6\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\right )}-\frac {8\,a\,\mathrm {atanh}\left (\frac {256\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{256\,a^3-256\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {512\,a^5}{b^2}-\frac {512\,a^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b^2}+\frac {512\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}-\frac {256\,a^3}{256\,a^3-256\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {512\,a^5}{b^2}-\frac {512\,a^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b^2}+\frac {512\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}+\frac {512\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{256\,a^3\,b+\frac {512\,a^5}{b}+512\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {512\,a^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b}-256\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )}{b^5\,d} \]

input
int(1/(cos(c + d*x)^2*(a*cos(c + d*x) + b*sin(c + d*x))^4),x)
 
output
((4*tan(c/2 + (d*x)/2)^2*(10*a^4 + b^4))/(a^2*b^3) - (2*tan(c/2 + (d*x)/2) 
^7*(4*a^4 + b^4))/(a*b^4) - (8*tan(c/2 + (d*x)/2)^4*(10*a^4 + b^4 - 2*a^2* 
b^2))/(a^2*b^3) + (4*tan(c/2 + (d*x)/2)^6*(10*a^4 + b^4))/(a^2*b^3) - (2*t 
an(c/2 + (d*x)/2)^3*(36*a^6 - 4*b^6 + a^2*b^4 - 88*a^4*b^2))/(3*a^3*b^4) + 
 (2*tan(c/2 + (d*x)/2)^5*(36*a^6 - 4*b^6 + a^2*b^4 - 88*a^4*b^2))/(3*a^3*b 
^4) + (2*tan(c/2 + (d*x)/2)*(4*a^4 + b^4))/(a*b^4))/(d*(a^3*tan(c/2 + (d*x 
)/2)^8 + tan(c/2 + (d*x)/2)^2*(12*a*b^2 - 4*a^3) + tan(c/2 + (d*x)/2)^6*(1 
2*a*b^2 - 4*a^3) - tan(c/2 + (d*x)/2)^4*(24*a*b^2 - 6*a^3) - tan(c/2 + (d* 
x)/2)^3*(18*a^2*b - 8*b^3) + tan(c/2 + (d*x)/2)^5*(18*a^2*b - 8*b^3) + a^3 
 + 6*a^2*b*tan(c/2 + (d*x)/2) - 6*a^2*b*tan(c/2 + (d*x)/2)^7)) - (8*a*atan 
h((256*a^3*tan(c/2 + (d*x)/2)^2)/(256*a^3 - 256*a^3*tan(c/2 + (d*x)/2)^2 + 
 (512*a^5)/b^2 - (512*a^5*tan(c/2 + (d*x)/2)^2)/b^2 + (512*a^4*tan(c/2 + ( 
d*x)/2))/b) - (256*a^3)/(256*a^3 - 256*a^3*tan(c/2 + (d*x)/2)^2 + (512*a^5 
)/b^2 - (512*a^5*tan(c/2 + (d*x)/2)^2)/b^2 + (512*a^4*tan(c/2 + (d*x)/2))/ 
b) + (512*a^4*tan(c/2 + (d*x)/2))/(256*a^3*b + (512*a^5)/b + 512*a^4*tan(c 
/2 + (d*x)/2) - (512*a^5*tan(c/2 + (d*x)/2)^2)/b - 256*a^3*b*tan(c/2 + (d* 
x)/2)^2)))/(b^5*d)